1 #!/bin/sh 2 3 if ! which realpath > /dev/null ; then 4 echo "Please install the realpath program." 1>&2 5 exit 1 6 fi 7 8 THISDIR=`dirname "$0"` 9 DIRNAME=`realpath "$THISDIR/.."` 10 PROGNAME=`basename "$0"` 11 12 if [ "$1" = '--help' ] || [ ! "$1" ] ; then 13 cat 1>&2 <<EOF 14 Usage: $PROGNAME <platform> | <build directory> 15 16 Update platform-specific files for the indicated platform type. If a build 17 directory is specified, try and obtain a configured platform type and use that 18 to update the files. 19 20 This program updates files in the distribution. They must then be installed 21 using the install program: 22 23 $THISDIR/install.sh 24 EOF 25 exit 1 26 fi 27 28 # Check for a build directory and obtain a platform type. 29 30 if [ -e "$1" ] && [ -e "$1/.config.platform" ] ; then 31 PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$1/.config.platform" | sed 's/^.*"\(.*\)".*$/\1/'` 32 33 # Check for a recognised platform type. 34 35 elif grep -q -F -e "$1" "$DIRNAME/conf/landfall-examples/platforms.txt" ; then 36 PLATFORM="$1" 37 38 # Show an error for anything else. 39 40 else 41 cat 1>&2 <<EOF 42 Platform not recognised: $1 43 EOF 44 exit 1 45 fi 46 47 # Panel configuration file in this distribution. 48 49 PANELCONF="$DIRNAME/conf/landfall-examples/mips-jz4740-panel.txt" 50 51 # Determine the required value of the panel configuration. 52 53 PANELLIB="rom/libpanel_$PLATFORM.so" 54 55 # Write it to the configuration file. 56 57 echo -n "$PANELLIB" > "$PANELCONF"