1 #!/bin/sh 2 3 THISDIR=`dirname "$0"` 4 DIRNAME=`readlink -f "$THISDIR/.."` 5 PROGNAME=`basename "$0"` 6 7 if [ "$1" = '--help' ] || [ ! "$1" ] ; then 8 cat 1>&2 <<EOF 9 Usage: $PROGNAME <platform> | <l4 directory> 10 11 Update platform-specific files for the indicated platform type. If a directory 12 is specified instead, try and obtain a configured platform type and use that 13 to update the files. 14 15 If a platform type is explicitly indicated, this program will update files in 16 the distribution. They must then be installed using the install program: 17 18 $THISDIR/install.sh 19 20 If a directory is specified instead, this program will update installed files, 21 leaving the distribution alone. 22 EOF 23 exit 1 24 fi 25 26 # Check for a build directory and obtain a platform type. 27 28 if [ -e "$1" ] ; then 29 30 # Look for the configuration in a subdirectory. 31 32 for FILENAME in "$1/"*"/.config.platform" ; do 33 34 # Test for a valid file since the expansion will yield the pattern 35 # itself if no files match. 36 37 if [ -e "$FILENAME" ] ; then 38 39 # Set the platform and the installation as target. 40 41 PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$FILENAME" | sed 's/^.*"\(.*\)".*$/\1/'` 42 TARGETDIR="$1" 43 break 44 else 45 cat 1>&2 <<EOF 46 The specified directory does not contain an existing, configured build 47 directory. Make sure that the configuration has been checked with the 48 appropriate tool specifying a platform as argument: 49 50 $DIRNAME/$PROGNAME <platform> 51 EOF 52 exit 1 53 fi 54 done 55 56 # Check for a recognised platform type. 57 58 elif grep -q -F -e "$1" "$DIRNAME/conf/landfall-examples/platforms.txt" ; then 59 60 # Set the platform and the distribution as target. 61 62 PLATFORM="$1" 63 TARGETDIR="$DIRNAME" 64 65 # Show an error for anything else. 66 67 else 68 cat 1>&2 <<EOF 69 Platform not recognised: $1 70 EOF 71 exit 1 72 fi 73 74 # Panel configuration file in the target area. 75 76 PANELCONF="$TARGETDIR/conf/landfall-examples/mips-jz4740-panel.txt" 77 78 # Determine the required value of the panel configuration. 79 80 PANELLIB="rom/libpanel_$PLATFORM.so" 81 82 # Write it to the configuration file. 83 84 echo -n "$PANELLIB" > "$PANELCONF"