Use upstream meta-renesas from github and update meta-rcar-gen3-adas integration
[AGL/meta-agl.git] / templates / machine / ebisu / 50_setup.sh
1 # setup proprietary gfx drivers and multimedia packages
2 pushd $METADIR 2>/dev/null
3
4 COPY_SCRIPT="$METADIR/bsp/meta-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh"
5 EXTRACT_DIR=$METADIR/binary-tmp
6 #EBISU_BIN_PATH should contain the path where the .zip archive of E3 binaries is.
7 #CUSTOM_RENESAS_CONFIG_SCRIPT should contain the custom script needed for setup. If not filled, do not failed, just warn.
8
9 # Check the ebisu binaries path
10 if [[ ! -d $EBISU_BIN_PATH ]] || [[ $EBISU_BIN_PATH == "" ]]; then
11         echo "ERROR: E3 Binary path not valid."
12         echo "HELP: Export the path where the E3 Binaries ZIP file is into 'EBISU_BIN_PATH' then launch the setup again."
13         echo "HELP: Example: '$ export EBISU_BIN_PATH=`pwd`/ebisu_binaries'"
14         exit 1
15 else
16         [ -z "$(ls -A $EBISU_BIN_PATH)" ] && echo "ERROR: $EBISU_BIN_PATH is empty. Add the E3 Binaries ZIP file inside and try again." && exit 1
17 fi
18
19 if [ -f $COPY_SCRIPT ]; then
20         # Extract the ZIP into the tmp directory
21         mkdir -p $EXTRACT_DIR
22         for PROPRIETARY_BIN in `ls -1 $EBISU_BIN_PATH/*.zip`
23         do
24                 unzip -q -o $PROPRIETARY_BIN -d $EXTRACT_DIR
25         done
26
27         cd $METADIR/bsp/meta-rcar-gen3/
28         $COPY_SCRIPT $EXTRACT_DIR
29         cd ..
30
31         # Clean temp dir
32         rm -r $EXTRACT_DIR
33 else
34         echo "ERROR: Script to copy Renesas proprietary drivers for $MACHINE not found. No additionnal setup to do."
35         exit 1
36 fi
37
38 if [[ ! -z $CUSTOM_RENESAS_CONFIG_SCRIPT ]] && [[ -f $CUSTOM_RENESAS_CONFIG_SCRIPT ]]; then
39         echo "Launching Renesas custom setup script ($CUSTOM_RENESAS_CONFIG_SCRIPT)..."
40         $CUSTOM_RENESAS_CONFIG_SCRIPT
41 else
42         echo "WARNING: Renesas custom setup script for $MACHINE not found."
43 fi
44
45 popd 2>/dev/null