#!/bin/bash
+TMP_UBOOT_PATH=tmp_uboot
BOOT_PATH="rpi4/boot"
USER_ID=`id -u`
GROUP_ID=`id -g`
IS_64BIT=`cat .config | grep "CONFIG_64BIT=y"`
+BUILD_ROOT=$PWD
+
+cleanup() {
+ cd $BUILD_ROOT
+ if [ -e $TMP_UBOOT_PATH ]; then
+ rm -rf ${TMP_UBOOT_PATH}
+ fi
+
+ if [ -e tmp_modules ]; then
+ rm -rf tmp_modules
+ fi
+
+ if [ -e tmp/lib/modules ]; then
+ rm -rf tmp/lib/modules
+ fi
+
+ if [ -n "$(mount | grep ${BUILD_ROOT}/tmp)" ]; then
+ sudo umount tmp
+ fi
+
+ if [ -e tmp ]; then
+ rm -rf tmp
+ fi
+}
+
+trap cleanup EXIT
+
+set -e
rm -f boot.img
rm -rf tmp
fi
# install u-boot files extracted from u-boot-rpi4 rpm package in download.tizen.org.
-TMP_UBOOT_PATH=tmp_uboot
+
mkdir -p ${TMP_UBOOT_PATH}
pushd ${TMP_UBOOT_PATH}
if [ -n "$IS_64BIT" ]; then
fi
echo ${BOOT_TARBALL}
+
+set +e