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"