1.1 --- a/tools/checkconfig.sh Tue May 29 19:02:55 2018 +0200
1.2 +++ b/tools/checkconfig.sh Tue May 29 22:26:18 2018 +0200
1.3 @@ -1,39 +1,66 @@
1.4 #!/bin/sh
1.5
1.6 -if ! which realpath > /dev/null ; then
1.7 - echo "Please install the realpath program." 1>&2
1.8 - exit 1
1.9 -fi
1.10 -
1.11 THISDIR=`dirname "$0"`
1.12 -DIRNAME=`realpath "$THISDIR/.."`
1.13 +DIRNAME=`readlink -f "$THISDIR/.."`
1.14 PROGNAME=`basename "$0"`
1.15
1.16 if [ "$1" = '--help' ] || [ ! "$1" ] ; then
1.17 cat 1>&2 <<EOF
1.18 -Usage: $PROGNAME <platform> | <build directory>
1.19 +Usage: $PROGNAME <platform> | <l4 directory>
1.20
1.21 -Update platform-specific files for the indicated platform type. If a build
1.22 -directory is specified, try and obtain a configured platform type and use that
1.23 +Update platform-specific files for the indicated platform type. If a directory
1.24 +is specified instead, try and obtain a configured platform type and use that
1.25 to update the files.
1.26
1.27 -This program updates files in the distribution. They must then be installed
1.28 -using the install program:
1.29 +If a platform type is explicitly indicated, this program will update files in
1.30 +the distribution. They must then be installed using the install program:
1.31
1.32 $THISDIR/install.sh
1.33 +
1.34 +If a directory is specified instead, this program will update installed files,
1.35 +leaving the distribution alone.
1.36 EOF
1.37 exit 1
1.38 fi
1.39
1.40 # Check for a build directory and obtain a platform type.
1.41
1.42 -if [ -e "$1" ] && [ -e "$1/.config.platform" ] ; then
1.43 - PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$1/.config.platform" | sed 's/^.*"\(.*\)".*$/\1/'`
1.44 +if [ -e "$1" ] ; then
1.45 +
1.46 + # Look for the configuration in a subdirectory.
1.47 +
1.48 + for FILENAME in "$1/"*"/.config.platform" ; do
1.49 +
1.50 + # Test for a valid file since the expansion will yield the pattern
1.51 + # itself if no files match.
1.52 +
1.53 + if [ -e "$FILENAME" ] ; then
1.54 +
1.55 + # Set the platform and the installation as target.
1.56 +
1.57 + PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$FILENAME" | sed 's/^.*"\(.*\)".*$/\1/'`
1.58 + TARGETDIR="$1"
1.59 + break
1.60 + else
1.61 + cat 1>&2 <<EOF
1.62 +The specified directory does not contain an existing, configured build
1.63 +directory. Make sure that the configuration has been checked with the
1.64 +appropriate tool specifying a platform as argument:
1.65 +
1.66 +$DIRNAME/$PROGNAME <platform>
1.67 +EOF
1.68 + exit 1
1.69 + fi
1.70 + done
1.71
1.72 # Check for a recognised platform type.
1.73
1.74 elif grep -q -F -e "$1" "$DIRNAME/conf/landfall-examples/platforms.txt" ; then
1.75 +
1.76 + # Set the platform and the distribution as target.
1.77 +
1.78 PLATFORM="$1"
1.79 + TARGETDIR="$DIRNAME"
1.80
1.81 # Show an error for anything else.
1.82
1.83 @@ -44,9 +71,9 @@
1.84 exit 1
1.85 fi
1.86
1.87 -# Panel configuration file in this distribution.
1.88 +# Panel configuration file in the target area.
1.89
1.90 -PANELCONF="$DIRNAME/conf/landfall-examples/mips-jz4740-panel.txt"
1.91 +PANELCONF="$TARGETDIR/conf/landfall-examples/mips-jz4740-panel.txt"
1.92
1.93 # Determine the required value of the panel configuration.
1.94
2.1 --- a/tools/install.sh Tue May 29 19:02:55 2018 +0200
2.2 +++ b/tools/install.sh Tue May 29 22:26:18 2018 +0200
2.3 @@ -1,12 +1,7 @@
2.4 #!/bin/sh
2.5
2.6 -if ! which realpath > /dev/null ; then
2.7 - echo "Please install the realpath program." 1>&2
2.8 - exit 1
2.9 -fi
2.10 -
2.11 THISDIR=`dirname "$0"`
2.12 -DIRNAME=`realpath "$THISDIR/.."`
2.13 +DIRNAME=`readlink -f "$THISDIR/.."`
2.14 PROGNAME=`basename "$0"`
2.15
2.16 if [ "$1" = '--help' ]; then
2.17 @@ -53,6 +48,10 @@
2.18 CLEAN=
2.19 fi
2.20
2.21 +# Check the configuration, if possible.
2.22 +
2.23 +"$THISDIR/checkconfig.sh" "$L4DIR"
2.24 +
2.25 # Generate binaries if appropriate.
2.26
2.27 if [ ! "$CLEAN" ] ; then
2.28 @@ -68,7 +67,7 @@
2.29 # Copy (or remove) each of the objects.
2.30
2.31 for OBJTYPE in 'conf' 'pkg' ; do
2.32 - TARGETDIR=`realpath "$L4DIR"`/$OBJTYPE
2.33 + TARGETDIR=`readlink -f "$L4DIR"`/$OBJTYPE
2.34 SOURCEDIR="$DIRNAME/$OBJTYPE"
2.35
2.36 # If cleaning, remove all objects.
2.37 @@ -76,7 +75,7 @@
2.38 if [ "$CLEAN" ] ; then
2.39 for OBJECT in "$SOURCEDIR/"* ; do
2.40 OBJNAME=`basename "$OBJECT"`
2.41 - ORIGIN=`realpath "$OBJECT"`
2.42 + ORIGIN=`readlink -f "$OBJECT"`
2.43 TARGET="$TARGETDIR/$OBJNAME"
2.44
2.45 if [ -d "$TARGET" ] ; then
2.46 @@ -92,7 +91,7 @@
2.47 # Make directories.
2.48
2.49 for OBJECT in `find "$SOURCEDIR" -type d -print` ; do
2.50 - ORIGIN=`realpath "$OBJECT"`
2.51 + ORIGIN=`readlink -f "$OBJECT"`
2.52 RELPATH=${ORIGIN#$SOURCEDIR/}
2.53
2.54 # Skip top-level directories.
2.55 @@ -111,7 +110,7 @@
2.56 # Copy new files.
2.57
2.58 for OBJECT in `find "$SOURCEDIR" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
2.59 - ORIGIN=`realpath "$OBJECT"`
2.60 + ORIGIN=`readlink -f "$OBJECT"`
2.61 RELPATH=${ORIGIN#$SOURCEDIR/}
2.62 TARGET="$TARGETDIR/$RELPATH"
2.63
2.64 @@ -124,7 +123,7 @@
2.65
2.66 for OBJECT in "$SOURCEDIR/"* ; do
2.67 OBJNAME=`basename "$OBJECT"`
2.68 - ORIGIN=`realpath "$OBJECT"`
2.69 + ORIGIN=`readlink -f "$OBJECT"`
2.70
2.71 # Examine the target object directory for files that are not provided
2.72 # by the distribution.
2.73 @@ -132,7 +131,7 @@
2.74 TARGET="$TARGETDIR/$OBJNAME"
2.75
2.76 for FILENAME in `find "$TARGET" -type f -not -name '.*' -not -name '*.orig' -not -name '*.rej' -print` ; do
2.77 - PATHNAME=`realpath "$FILENAME"`
2.78 + PATHNAME=`readlink -f "$FILENAME"`
2.79 RELPATH=${PATHNAME#$TARGET}
2.80 SOURCE="$ORIGIN/$RELPATH"
2.81
2.82 @@ -144,7 +143,7 @@
2.83 # Remove obsolete directories.
2.84
2.85 for FILENAME in `find "$TARGET" -depth -type d -print` ; do
2.86 - PATHNAME=`realpath "$FILENAME"`
2.87 + PATHNAME=`readlink -f "$FILENAME"`
2.88 RELPATH=${PATHNAME#$TARGET}
2.89 SOURCE="$ORIGIN/$RELPATH"
2.90
3.1 --- a/tools/makefonts.sh Tue May 29 19:02:55 2018 +0200
3.2 +++ b/tools/makefonts.sh Tue May 29 22:26:18 2018 +0200
3.3 @@ -1,12 +1,7 @@
3.4 #!/bin/sh
3.5
3.6 -if ! which realpath > /dev/null ; then
3.7 - echo "Please install the realpath program." 1>&2
3.8 - exit 1
3.9 -fi
3.10 -
3.11 THISDIR=`dirname "$0"`
3.12 -DIRNAME=`realpath "$THISDIR/.."`
3.13 +DIRNAME=`readlink -f "$THISDIR/.."`
3.14 PROGNAME=`basename "$0"`
3.15
3.16 UNIFONT='/usr/share/unifont/unifont.hex'