hdl: Store build artifacts in a timestamped directory, with reports

FPGA build artifacts are now copied to a <rev>x<size>-<timestamp>
directory. The .rbf, SHA256 & MD5 checksums, and reports/summaries are
copied into this directory.

This is intended to help keep files with their associated FPGA images, as
items in work/ are clobbered with each invocation of build_bladerf.sh.
This commit is contained in:
Jon Szymaniak 2014-10-23 12:56:50 -04:00
commit d7d93c173c

View file

@ -180,20 +180,38 @@ else
fi
popd
RBF="$rev"x"$size".rbf
cp "work/output_files/$rev.rbf" $RBF
BUILD_TIME_DONE="$(cat work/output_files/$rev.done)"
BUILD_TIME_DONE=$(date -d"$BUILD_TIME_DONE" '+%F_%H.%M.%S')
BUILD_NAME="$rev"x"$size"
BUILD_OUTPUT_DIR="$BUILD_NAME"-"$BUILD_TIME_DONE"
RBF=$BUILD_NAME.rbf
mkdir -p "$BUILD_OUTPUT_DIR"
cp "work/output_files/$rev.rbf" "$BUILD_OUTPUT_DIR/$RBF"
for file in work/output_files/*rpt work/output_files/*summary; do
new_file=$(basename $file | sed -e s/$rev/"$BUILD_NAME"/)
cp $file "$BUILD_OUTPUT_DIR/$new_file"
done
pushd $BUILD_OUTPUT_DIR
md5sum $RBF > $RBF.md5sum
sha256sum $RBF > $RBF.sha256sum
MD5SUM=$(cat $RBF.md5sum | awk '{ print $1 }')
SHA256SUM=$(cat $RBF.sha256sum | awk '{ print $1 }')
popd
echo ""
echo "##########################################################################"
echo " Done! Image copied to: $rev"x"$size.rbf"
echo " "
echo " MD5: $MD5SUM"
echo " SHA256: $SHA256SUM"
echo " Done! Image, reports, and checksums copied to:"
echo " $BUILD_OUTPUT_DIR"
echo ""
echo " $RBF checksums:"
echo " MD5: $MD5SUM"
echo " SHA256: $SHA256SUM"
echo ""
cat "$BUILD_OUTPUT_DIR/$BUILD_NAME.fit.summary" | sed -e 's/^\(.\)/ \1/g'
echo "##########################################################################"
echo ""