2018-05-29 | Paul Boddie | raw annotate files changeset graph | Changed checkconfig.sh to accept the l4 directory and to deduce the build directory, also making it update installed files if a directory is specified, with the distribution being updated otherwise. The script is then run by install.sh to automatically make updated resources consistent with the configured platform. Changed realpath invocations to "readlink -f" invocations, eliminating the dependency. |
1 #!/bin/sh 2 3 CONF="$1" 4 5 if [ ! "$CONF" ] || [ ! -e "$CONF" ] ; then 6 cat 1>&2 <<EOF 7 Usage: $0 <configuration filename> 8 9 List modules required by the given system/payload configuration. These modules 10 should be added to the configuration file so that the dynamic linker can find 11 them in the running system. 12 EOF 13 exit 1 14 fi 15 16 BIN=mybuild/bin/mips_32/l4f 17 TMPLIBS=_libs.txt 18 19 echo -n > "$TMPLIBS" 20 21 for MODULE in `grep '^module ' "$CONF" | sed 's/module //'` ; do 22 PROG=`basename "$MODULE" .cfg` 23 if [ "$PROG" != "$MODULE" ] ; then 24 continue 25 fi 26 PROG=`basename "$MODULE" .io` 27 if [ "$PROG" != "$MODULE" ] ; then 28 continue 29 fi 30 PROG=`basename "$MODULE" .so` 31 if [ "$PROG" != "$MODULE" ] ; then 32 continue 33 fi 34 if [ ! -e "$BIN/$PROG" ] ; then 35 echo "Not found: $PROG" 1>&2 36 exit 1 37 fi 38 mipsel-linux-gnu-readelf -d "$BIN/$PROG" | grep NEEDED | sed 's/.*\[//;s/\]$//' >> "$TMPLIBS" 39 done 40 41 # Explicitly add undetected module. 42 43 echo "libl4sys-direct.so" >> "$TMPLIBS" 44 45 sort -u "$TMPLIBS" | sed 's/^/module /' 46 rm "$TMPLIBS"