#!/bin/sh

# copyImages.sh

td="$1"
echo "td is $td"

# Verzeichnis mit images relativ zum svn-buildroot-wurzelverzeichnis
output=../output_standard

# gehe zu wurzelverzeichnis anhand der position dieser datei
cd $(dirname $0)
cd ../../../..

# output darf relativ zum buildroot-workspace sein oder absolut
if [ -d "${output}/images" ]; then
    cd ${output}/images
else
	cd $last_dir/images
fi

cp MLO ${td}/MLO
cp u-boot.img ${td}/u-boot

cp uImage.CV_34_39_500 ${td}
cp uImage.CV_34_39_500A ${td}
cp uImage.CV_34_39_500B ${td}
cp uImage.CV_34_39_500B_KiTi ${td}
cp uImage.CV_34_39_500B_BM ${td}

if [ -e ${BASE_DIR}/copyImages.sh ]
then
	${BASE_DIR}/copyImages.sh $td
fi

tar -cvf ${td}/rootfs.ubi.tgz rootfs.ubi
