ebisu: Add the support of a custom setup script
[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-renesas-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         unzip -q -o $EBISU_BIN_PATH/*.zip -d $EXTRACT_DIR
23
24         cd $METADIR/bsp/meta-renesas-rcar-gen3/
25         $COPY_SCRIPT $EXTRACT_DIR
26         cd ..
27
28         # Clean temp dir
29         rm -r $EXTRACT_DIR
30 else
31         echo "ERROR: Script to copy Renesas proprietary drivers for $MACHINE not found. No additionnal setup to do."
32         exit 1
33 fi
34
35 if [[ ! -z $CUSTOM_RENESAS_CONFIG_SCRIPT ]] && [[ -f $CUSTOM_RENESAS_CONFIG_SCRIPT ]]; then
36         echo "Launching Renesas custom setup script ($CUSTOM_RENESAS_CONFIG_SCRIPT)..."
37         $CUSTOM_RENESAS_CONFIG_SCRIPT
38 else
39         echo "WARNING: Renesas custom setup script for $MACHINE not found."
40 fi
41
42 popd 2>/dev/null