Files
domo/bsp/board/raspberrypi/scripts/post-build.sh

41 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
MKIMAGE=$HOST_DIR/usr/bin/mkimage
GENEXT2FS=$HOST_DIR/usr/bin/genext2fs
# Catch post-build Error
function error {
echo "post-build Failed."
exit 1;
}
set -e
trap error ERR
echo "==> Raspberry post-build:"
echo "BR_STAGING: ${BR_STAGING}"
echo "BR_PROJECT: " ${BR_PROJECT}
# Generate uboot scripts
for cmd_file in `ls ${BR_PROJECT}/uboot/*.cmd`
do
echo "uboot script: $cmd_file"
# Get file name without extention.
name=`echo "$(basename ${cmd_file})" | cut -d'.' -f1`
echo "cmd: $MKIMAGE -C none -A arm -T script -d ${cmd_file} ${BINARIES_DIR}/${name}.scr"
$MKIMAGE -C none -A arm -T script -d ${cmd_file} ${BINARIES_DIR}/${name}.scr
done
# Copy the overlay of the target.
if [ -d ${PROJECT}/ovl ]; then
mkdir -p ${BR_STAGING}/buildroot/target/usr/local/
cp -a ${BR_PROJECT}/ovl/* ${BR_STAGING}/buildroot/target/
fi
# Finaly apply post build script of the target if the script exist.
if [ -e ${PROJECT}/post-build.sh ]; then
${PROJECT}/post-build.sh
fi