2014-03-13 04:35:51 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# This is a helper script intended to be called from
|
|
|
|
# drivers/dahdi/firmware/Makefile to install the different firmware version.
|
|
|
|
|
|
|
|
FIRMWARE_PATTERN=$1
|
|
|
|
FIRMWARE_VERSION=$2
|
|
|
|
DESTDIR=$3
|
2014-04-01 21:45:09 +08:00
|
|
|
target="$DESTDIR/lib/firmware"
|
2014-03-13 04:35:51 +08:00
|
|
|
|
2014-04-01 21:45:09 +08:00
|
|
|
if ! test -f $target/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}; then
|
|
|
|
echo "Installing ${FIRMWARE_PATTERN}.bin to $target"
|
2014-03-13 12:01:47 +08:00
|
|
|
tar --no-same-owner -xf ${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}.tar.gz || exit 1
|
2014-04-01 21:45:09 +08:00
|
|
|
install -m 644 ${FIRMWARE_PATTERN}.bin $target || exit 1
|
|
|
|
rm -rf $target/.${FIRMWARE_PATTERN}-*
|
|
|
|
touch $target/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}
|
2014-03-13 12:01:47 +08:00
|
|
|
# Remove the .bin file so that if the version is reverted, it will not
|
|
|
|
# be installed with a non-matching ${FIRMARE_VERSION} file.
|
|
|
|
rm ${FIRMWARE_PATTERN}.bin
|
2014-03-13 04:35:51 +08:00
|
|
|
else
|
|
|
|
echo "Firmware ${FIRMWARE_PATTERN}.bin is already installed with required version ${FIRMWARE_VERSION}"
|
|
|
|
fi
|