2013-07-01 16:20:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Ensure that all binaries listed in ramdisk elements, exist
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
2014-04-03 02:24:15 +00:00
|
|
|
set -o pipefail
|
2013-07-01 16:20:15 +00:00
|
|
|
|
|
|
|
export TARGET_DIR="/tmp/in_target.d/"
|
|
|
|
|
|
|
|
if [ -z $TARGET_DIR ] ; then
|
2014-05-02 17:02:38 +00:00
|
|
|
echo "Target dir not specified"
|
|
|
|
exit 1
|
2013-07-01 16:20:15 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d $TARGET_DIR ] ; then
|
2014-05-02 17:02:38 +00:00
|
|
|
echo "Unable to find specified directory in target: $TARGET_DIR"
|
|
|
|
bash
|
|
|
|
exit 1
|
2013-07-01 16:20:15 +00:00
|
|
|
fi
|
|
|
|
|
2014-04-03 22:49:18 +00:00
|
|
|
BINARY_DEPS=
|
|
|
|
|
2013-07-01 16:20:15 +00:00
|
|
|
for _FILE in $(ls ${TARGET_DIR}/binary-deps.d/) ; do
|
2014-05-02 17:02:38 +00:00
|
|
|
_FILE="${TARGET_DIR}/binary-deps.d/${_FILE}"
|
|
|
|
if [ -a $_FILE ]; then
|
|
|
|
for _LINE in $(cat $_FILE) ; do
|
|
|
|
BINARY_DEPS="${BINARY_DEPS} $_LINE"
|
|
|
|
done
|
|
|
|
fi
|
2013-07-01 16:20:15 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for _BIN in $BINARY_DEPS ; do
|
2017-05-18 18:09:32 +00:00
|
|
|
_LOCATION=$(type -p "$_BIN" || echo "")
|
2014-05-02 17:02:38 +00:00
|
|
|
if [ -z "$_LOCATION" ]; then
|
|
|
|
echo "$_BIN is not found in PATH. Please ensure your elements install it"
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-07-01 16:20:15 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$BINARY_DEPS" == "" ]; then
|
2014-05-02 17:02:38 +00:00
|
|
|
echo "No binary-deps found"
|
2013-07-01 16:20:15 +00:00
|
|
|
else
|
2014-05-02 17:02:38 +00:00
|
|
|
DEPS_OUTPUT="/etc/dib_binary_deps"
|
|
|
|
echo "Creating binary_deps record at: ${DEPS_OUTPUT}"
|
|
|
|
echo "$BINARY_DEPS" >${DEPS_OUTPUT}
|
2013-07-01 16:20:15 +00:00
|
|
|
fi
|